<?= $this->Html->script('ckeditor/ckeditor') ?>
<?= $this->Html->script('ckeditor/adapters/jquery') ?>

<p><?= $this->Session->flash() ?></p>

<?= $this->Form->create('Page', array(
    'url'    => "/admin_pages/save/{$page}"
)) ?>

    <p><?= $this->Form->textarea('html', array(
        'value' => $this->element("pages/{$page}"),
        'class' => 'ckedit'
    )) ?></p>

    <?= $this->Form->submit('Sačuvaj') ?>
<?= $this->Form->end() ?>

<script type="text/javascript">
$(function(){
    $('.ckedit').ckeditor(function(){
        
    }, {
        width: 800,
        height:400,
        contentsCss: '/css/style.min.css',
        
        filebrowserBrowseUrl:      "/js/ckfinder/ckfinder.html", 
        filebrowserImageBrowseUrl: "/js/ckfinder/ckfinder.html?type=Images", 
        filebrowserFlashBrowseUrl: "/js/ckfinder/ckfinder.html?type=Flash", 
        filebrowserUploadUrl:      "/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files", 
        filebrowserImageUploadUrl: "/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images", 
        filebrowserFlashUploadUrl: "/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash"
    }); 
});
</script>